import request from '@/utils/request'

export function fetchUploadConfig() {
  return request({
    url: '/uploader/config',
    method: 'get'
  })
}
export function fetchFileUpload(form) {
  return request({
    url: '/uploader/file',
    method: 'post',
    data: form
  })
}
export function fetchImageUpload(data) {
  return request({
    url: '/uploader/image',
    method: 'post',
    data: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  })
}
export function fetchImageUploadNoWater(data) {
  return request({
    url: '/uploader/image-no-water',
    method: 'post',
    data: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  })
}
export function fetchImageUploadByBase64(form) {
  return request({
    url: '/backend/uploader/imagebase64',
    method: 'post',
    data: {...form}
  })
}

export function fetchAvatarUploadByBase64(form) {
  return request({
    url: '/backend/uploader/avatarbase64',
    method: 'post',
    data: {...form}
  })
}
